//
//  SEOnlineReserveHeader.swift
//  SmartEyeForPatient
//
//  Created by QDSG on 2021/4/6.
//

import UIKit

class SEOnlineReserveHeader: UIView {

    var attentionHandler:(() -> Void)?
    
    func update(with viewModel: SEInquiryInfoViewModel) {
        avatarView.kf.setAvatarImage(urlString: viewModel.doctorDetail.imgPath,
                                     placeholder: viewModel.avatarPlaceholder)
        nameLabel.text = viewModel.doctorDetail.name
        jobTitleLabel.text = viewModel.jobTitleAndDepartment
    }

    @IBOutlet private weak var avatarView: UIImageView!
    @IBOutlet private weak var nameLabel: UILabel!
    @IBOutlet private weak var jobTitleLabel: UILabel!
    @IBOutlet private weak var attentionButton: UIButton! {
        didSet {
            attentionButton.layer.cornerRadius = attentionButton.height / 2.0
            attentionButton.layer.masksToBounds = true
        }
    }
    @IBAction func attentionBtnAction(_ sender: UIButton) {
        attentionHandler?()
    }
}
